package com.tuanzi.loan.schedule.receipt;

import com.base.common.log.LogService;
import com.tuanzi.loan.business.service.statistics.StatHitSuccessService;
import com.tuanzi.loan.core.aspect.Debug;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.text.ParseException;

/**
 * @author Simon
 * @date 2019/08/02 17:34
 */
@Debug
@Slf4j
@Service
@Transactional
public class StatisticsStatHitSuccessScheduler {

    @Autowired
    private StatHitSuccessService statHitSuccessService;

    @Scheduled(cron = "${cron.statistics-stat-hit-success-task}")
    public void statisticNewByDay(){
        LogService.info("每日撞库统计执行");
        try {
            statHitSuccessService.stat("");
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
